<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
$pageParams["noDisplay"]=1;

header('Content-Type: text/xml');


require_once(CLASS_WIKI);

$_REQUEST["wiki"]=strtolower($_REQUEST["wiki"]);

$Wiki = new Wiki($_REQUEST["wiki"]);

if ($_REQUEST["page"]!="")
{
    $aWikiParams["WikiPage"]=$_REQUEST["page"];
}
else
{
    $aWikiParams["WikiPage"]=$Wiki->aWikiProperties["defaultWikiPage"];
    
}

$Wiki->EditPage($aWikiParams["WikiPage"], $_GET["version"]);

if ($Wiki->bShowCheckedOutWarning)
{
    if (is_array($Wiki->aCheckedOutUser))
    {
        $nCheckOut=count($Wiki->aCheckedOutUser);
	for ($i=0; $i<$nCheckOut; $i++)
	{
	    $sUsers.=$Wiki->aCheckedOutUser[$i].", ";
	}
    }
}

echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>
<response>
<method>checkwiki</method>
  <result><?=$sUsers;?>
  </result>
</response>


